package com.example.demo.sys.model;

import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List;


/**
 * Created by 蔡超 on 2018/10/6.
 */

@Getter
@Setter
@NoArgsConstructor
public class ValidationDemo {
    @NotBlank(message = "用户名不能为空")
    private String name;

    @NotNull(message = "年龄不能为空")
    @Range(min = 1, max = 99,message = "年龄范围1-99")
    private Integer age;

    @NotEmpty(message = "list不能为空")
    private List<String> list;
}
